<template>
    <div>
        <HeaderS :styleColor="1" />
        <div class="page-content">
            <div class="main-wrap">
                <div :class="$store.getters.screenWidth > 1000 ? 'bread-crumb-box' : 'h5s'">
                    <div class="width-1360">
                        <img src="@/assets/img/home.png" class="home-icon">
                        <span>当前位置：</span>
                        <span>
                            <router-link to="/">&nbsp;首页</router-link>
                            <img src="@/assets/img/right.png" class="left-icon">
                        </span>
                        <span>
                            <router-link to="/culture-xian">&nbsp;文化西安</router-link>
                            <img src="@/assets/img/right.png" class="left-icon">
                        </span>
                        <span>
                            <span class="now">{{info.post_title}}</span>
                        </span>
                    </div>
                </div>
                <div class="main">
                    <div class="title">{{ info.post_title }}</div>
                    <div class="content" v-html="htmlCon"></div>
                </div>
            </div>
        </div>
        <FooterS />
    </div>
</template>
<script>

export default ({
    data() {
        return {
            content: '<p>Hello, World!</p>', // 初始内容，可以是富文本HTML字符串
            info: '',
            htmlCon:''
        }
    },
    computed: {
       
        cid() {
            return this.$route.query.id
        }
    },
    watch: {
        cid(n, o) {
            window.scrollTo({ top: 0, behavior: 'smooth' });
            this.getArticle(n)
        }
    },
    created() {
        // window.scrollTo({ top: 0, behavior: 'smooth' });
        this.getArticle(this.$route.query.id)
    },
    methods: {
        getArticle(cid) {
            this.$api.getClassArticle({ cid }).then((res) => {
                if (res.data.code == 1) {
                    this.info = res.data.data.info
                  this.htmlCon =  this.info.post_content
                }
            })
        },
  
    }
})
</script>
<style lang="scss" scoped>
.main-wrap .main .content{
    padding: 0 2.08333vw 3.125vw;
}
.bread-crumb-box {
    ::v-deep span {
        a:hover {
            color: #e31c1c;
        }
    }
}

.main-wrap .main .summary-wrap {
    height: 0.72917vw;
    font-size: 0.72917vw;
    line-height: 0.72917vw;
    color: #999;
    text-align: center;
}

.main-wrap .main .summary-wrap span {
    margin: 0 0.52083vw;
}

.main-wrap .main .line {
    width: 66.66667vw;
    height: 1px;
    background-color: #eeeeee;
    margin: 1.82292vw auto 2.08333vw;
}

.main-wrap .main .title {
    height: 1.61458vw;
    font-size: 1.5625vw;
    font-weight: 700;
    line-height: 1.61458vw;
    color: #333;
    margin: 0 0 1.77083vw;
    text-align: center;
}

.bread-crumb-box {
    padding: 2.60417vw 0 3.125vw;
}

.main-wrap .main {
    width: 70.83333vw;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.bread-crumb-box .width-1360 {
    display: -webkit-box;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
}

.width-1360 {
    width: 70.83333vw;
    margin: 0 auto;
}

.main-wrap {
    padding-top: 3.64583vw;
}

.bread-crumb-box .home-icon {
    width: 0.88542vw;
    line-height: 1;
    color: #999;
    margin-right: 0.52083vw;
    display: inline-block;
    vertical-align: middle;
}

.bread-crumb-box span {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.72917vw;
    font-weight: 400;
    color: #666;
    line-height: 0.9375vw;
}

.bread-crumb-box span a {
    color: #666;
}

.bread-crumb-box .left-icon {
    color: #666;
    margin: 0 0.52083vw;
    display: inline-block;
    vertical-align: middle;
}

.bread-crumb-box span:nth-last-of-type(1) {
    color: #333;
}

.bread-crumb-box span .now {
    color: #e31c1c
}
.content{
   ::v-deep img,video{
    max-width: 100%;
    height: auto;
   }
}
@media(max-width:1000px) {
    .main {
        padding-top: 0;
    }

    .h5s-content {
        min-height: -webkit-calc(100vh - 6rem);
        min-height: calc(100vh - 6rem);
    }

    .h5s {
        font-size: 0;
        padding: 0.5rem 0;
    }

    .h5s .width-1360 {
        width: 100%;
        padding: 0 0.3rem;
        font-size: 0.2rem;
        color: #666;
        display: -webkit-box;
        display: flex;
        -webkit-box-align: center;
        align-items: center;
    }

    .h5s .width-1360 .home-icon {
        width: 0.22rem;
        margin-right: 0.1rem;
    }

    .h5s .width-1360 a {
        color: #666;
    }

    .h5s .width-1360 .left-icon {
        margin: 0 0.1rem;
    }

    .h5s span .now {
        color: #e31c1c
    }

    .main-wrap {
        padding-top: 0;
    }

    .main-wrap .main {
        width: 100%;
        padding: 0 0.3rem;
        margin: 0 auto;
        background: #fff;
        overflow: hidden;
    }

    .main-wrap .main .title {
        font-size: 0.4rem;
        font-weight: 700;
        color: #333;
        margin: 0 0 0.3rem;
        text-align: center;
        height: auto;
        line-height: normal;
    }

    .main-wrap .main .summary-wrap {
        font-size: 0;
    }

    .main-wrap .main .line {
        width: 100%;
        height: 0.01rem;
        background-color: #eee;
        margin: 0.3rem auto 0.4rem;
    }
}
</style>